<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/top.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script src="${pageContext.request.contextPath}/static/myJs/user.js"></script>
<title>Insert title here</title>
</head>
<body>
<div style="padding-left: 15px;padding-right: 15px;">
	<h3 class="page-header" style="margin-top: 10px;" id="topTitle">用户管理</h3>
		<form id="searchForm" class="form-inline" style="padding-left: 15px;">
			<div class="form-group" style="width: 33%;margin-bottom: 5px;">
				<label for="userCode">用户名：</label> 
				<input type="text" class="form-control" style="width: 180px;" id="userCode" name="userCode" placeholder="用户名">
			</div>
			<div class="form-group" style="width: 33%;margin-bottom: 5px;">
				<label for="username">登录名：</label> 
				<input type="text" class="form-control" style="width: 180px;" id="username" name="username" placeholder="登录名">
			</div>
			<div class="form-group" style="width: 33%;margin-bottom: 5px;">
				<label for="locked">是否锁定：</label> 
				<select id="locked" name="locked" class="form-control" style="width: 180px;">
				  <option value="">---请选择---</option>
				  <option value="0">否</option>
				  <option value="1">是</option>
				</select>
			</div>
			<div class="form-group" style="width: 33%;">
				
			</div>
			<div class="form-group" style="width: 33%;">
			</div>
			<div class="form-group" align="right" style="width: 33%;padding-right: 100px;">
				<input class="btn btn-info" type="button" value="新  增" onclick="addUser();">
				<input class="btn btn-info" type="button" value="查  询" onclick="doSearch();">
				<input class="btn btn-info" type="button" value="重  置" onclick="formReset('searchForm');">
			</div>
		</form>
	<div style="margin-top: 10px;">
		<table id="user_table">
		</table>
	</div>

	<!-- Modal -->
	<div class="modal fade" id="userModal" tabindex="-1" role="dialog" aria-labelledby="userModalLabel">
	  <div class="modal-dialog" role="document">
	    <div class="modal-content">
	      <div class="modal-header">
	        <!-- <button type="button" class="close" data-dismiss="modal" aria-label="Close">
	        	<span aria-hidden="true">&times;</span>
	        </button> -->
	        <h4 class="modal-title" id="userModalLabel">用户修改</h4>
	      </div>
	      <div class="modal-body">
	        <form id="userForm" class="form-inline" style="padding-left: 15px;">
	        <input type="hidden" id="opFlag" value="" />
	        <input type="hidden" id="user_id" name="id" />
			<div class="form-group" style="margin-bottom: 5px;padding-right: 20px;">
				<label for="user_code" style="width:70px;">用户名：</label> 
				<input type="text" class="form-control" style="width:150px;" id="user_code" name="userCode" placeholder="用户名">
			</div>
			<div class="form-group" style="margin-bottom: 5px;">
				<label for="user_name" style="width:70px;">登录名：</label> 
				<input type="text" class="form-control" style="width:150px;" id="user_name" name="username" placeholder="登录名">
				</select>
			</div>
			<div class="form-group" style="margin-bottom: 5px;padding-right: 20px;">
				<label for="password">用户密码：</label> 
				<input type="password" class="form-control" style="width:150px;" id="password" name="password" placeholder="密码">
			</div>
			<div class="form-group" style="">
				<label for="user_locked">是否锁定：</label> 
				<select id="user_locked" name="locked" class="form-control" style="width: 150px;">
					<option value="">---请选择---</option>
				  	<option value="0">否</option>
				  	<option value="1">是</option>
				</select>
			</div>
		</form>
	      </div>
	      <div class="modal-footer">
	        <button type="button" class="btn btn-default" onclick="modelColse();" data-dismiss="modal">关闭</button>
	        <button type="button" class="btn btn-primary" onclick="userSave();" id="formSave">保存</button>
	      </div>
	    </div>
	  </div>
	</div>

	<div class="modal fade" id="roleModal" tabindex="-1" role="dialog" aria-labelledby="roleModalLabel" aria-hidden="true">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal" aria-label="Close">
						<span aria-hidden="true"></span>
					</button>
					<h4 class="modal-title">用户角色分配</h4>
				</div>
				<div class="modal-body">
					<input type="hidden" id="userId" name="userId">
					<table id="role_table">
                               
                    </table>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" onclick="roleTableRefresh();" data-dismiss="modal">关闭</button>
					<button type="button" class="btn btn-primary" onclick="getSelectRoles();" id="">确定</button>
				</div>
			</div>
			<!-- /.modal-content -->
		</div>
		<!-- /.modal-dialog -->
	</div>

</div>
</body>
</html>